#include <QCoreApplication>
#include <QDebug>
#include <QString>
#include "processlinuxwrap.h"
#include <QTextStream>

int main(int argc,char* argv[])
{
    QCoreApplication a(argc, argv);

    QTextStream cin(stdin,QIODevice::ReadOnly);

    ProcessLinuxWrap process;
    pid_t pid=0;
#if 0
    ProcessLinuxWrap::ErrCode errcode = process.getPid("thrift_client",&pid);
    qDebug()<< "process.getPid() return val = " << errcode;
    qDebug()<< "process.getPid()'s Param:pPid's Val = " << pid;

    QString str_path = "/home/xhj/qzm/NetAudio_PC2/build-x_rt_bcst-Desktop_Qt_5_12_2_GCC_64bit-Debug/x_rt_bcst";
    errcode = process.createDetachedPid(str_path);
    qDebug()<<errcode;
#endif
    qDebug()<<cin.readLine();
    pid_t readyKillPid;
    qDebug() << process.getPid("x_rt_bcst",&readyKillPid);
    qDebug() << process.killPid(readyKillPid);

    return 0;
}
